package com.saint.flowable;


import com.saint.flowable.service.MyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

@SpringBootApplication
@Slf4j
public class FlowableApplication implements CommandLineRunner, ApplicationContextAware {


    public static void main(String[] args) {
        SpringApplication.run(FlowableApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("######################################\t{} Start Over\t######################################", this.getClass().getSimpleName());
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        MyService myService = applicationContext.getBean(MyService.class);
        myService.hi();
    }
}
